//
//  DrawerController.h
//  Fangmm
//
//  Created by 阮琦 on 16/1/29.
//  Copyright © 2016年 com.fangmm. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol DrawerControllerChild;
@protocol DrawerControllerPresenting;

@interface DrawerController : UIViewController

@property(nonatomic, strong, readonly) UIViewController<DrawerControllerChild, DrawerControllerPresenting> *leftViewController;

@property(nonatomic, strong, readonly) UIViewController<DrawerControllerChild, DrawerControllerPresenting> *centerViewController;

@property (assign, nonatomic) BOOL isOpen;
@property (assign, nonatomic) BOOL isInAction;

- (id)initWithLeftViewController:(UIViewController<DrawerControllerChild, DrawerControllerPresenting> *)leftViewController
            centerViewController:(UIViewController<DrawerControllerChild, DrawerControllerPresenting> *)centerViewController;

- (void)open;

- (void)close;

- (void)reloadCenterViewControllerUsingBlock:(void (^)(void))reloadBlock;

- (void)replaceCenterViewControllerWithViewController:(UIViewController<DrawerControllerChild, DrawerControllerPresenting> *)viewController;

@end

#pragma mark - DrawerProtocol
@protocol DrawerControllerChild <NSObject>

@property(nonatomic, weak) DrawerController *drawer;

@end

@protocol  DrawerControllerPresenting <NSObject>

@optional
- (void)drawerControllerWillOpen:(DrawerController *)drawerController;

- (void)drawerControllerDidOpen:(DrawerController *)drawerController;

- (void)drawerControllerWillClose:(DrawerController *)drawerController;

- (void)drawerControllerDidClose:(DrawerController *)drawerController;

@end
